package Demo02;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28463
 * Date: 2022—05—29
 * Time: 8:19
 */
public class Test03 {
    public static void main(String[] args) {
        StringBuffer stringBuffer= new StringBuffer();
        stringBuffer.append("hello");
        stringBuffer.append("world");

        stringBuffer.reverse();
        System.out.println(stringBuffer);//dlrowolleh
    }
    public static void main2(String[] args) {
/*        String str = "hello";
        str += " world";
        System.out.println(str);*/

        StringBuilder stringBuilder= new StringBuilder();
        stringBuilder.append("hello");
        stringBuilder.append("world");
/*
        String s = stringBuilder.toString();
        System.out.println(s);*/

        stringBuilder.reverse();
        System.out.println(stringBuilder);
    }
    public static void main1(String[] args) {
        String str = "hello";
        str += " world";
        System.out.println(str);
    }
}
